package top.cardone.api.vx.usercenter.user

import org.apache.commons.lang3.StringUtils
import top.cardone.usercenter.service.UserService
import top.cardone.context.ApplicationContextHolder
import top.cardone.core.CodeException

class modifyModal implements java.io.Serializable {
    def input(input) {
        ["userId": input.userId]
    }

    def validation(input) {
//      if (StringUtils.isBlank(input?.userId)) {
//          throw new CodeException("userId required", "用户标识必填")
//      }
    }

    def func(input) {
		ApplicationContextHolder.getBean(UserService.class).findOneByUserId(input)
    }

    def output(output) {
        def newOutput = [:]

		newOutput?.address = output?.ADDRESS
		newOutput?.age = output?.AGE
		newOutput?.aliasName = output?.ALIAS_NAME
		newOutput?.areaCode = output?.AREA_CODE
		newOutput?.batchNo = output?.BATCH_NO
		newOutput?.beginDate = output?.BEGIN_DATE
		newOutput?.birthday = output?.BIRTHDAY
		newOutput?.callName = output?.CALL_NAME
		newOutput?.cityCode = output?.CITY_CODE
		newOutput?.companyName = output?.COMPANY_NAME
		newOutput?.compatibleDepartmentCode1 = output?.COMPATIBLE_DEPARTMENT_CODE_1
		newOutput?.compatibleDepartmentCode2 = output?.COMPATIBLE_DEPARTMENT_CODE_2
		newOutput?.compatiblePassword1 = output?.COMPATIBLE_PASSWORD_1
		newOutput?.compatiblePassword2 = output?.COMPATIBLE_PASSWORD_2
		newOutput?.compatibleUserCode1 = output?.COMPATIBLE_USER_CODE_1
		newOutput?.compatibleUserCode2 = output?.COMPATIBLE_USER_CODE_2
		newOutput?.contact = output?.CONTACT
		newOutput?.countryCode = output?.COUNTRY_CODE
		newOutput?.createdByCode = output?.CREATED_BY_CODE
		newOutput?.createdById = output?.CREATED_BY_ID
		newOutput?.createdDate = output?.CREATED_DATE
		newOutput?.dataStateCode = output?.DATA_STATE_CODE
		newOutput?.departmentCode = output?.DEPARTMENT_CODE
		newOutput?.departmentId = output?.DEPARTMENT_ID
		newOutput?.diplomaCode = output?.DIPLOMA_CODE
		newOutput?.email = output?.EMAIL
		newOutput?.endDate = output?.END_DATE
		newOutput?.firstName = output?.FIRST_NAME
		newOutput?.flagCode = output?.FLAG_CODE
		newOutput?.flagObjectCode = output?.FLAG_OBJECT_CODE
		newOutput?.folkCode = output?.FOLK_CODE
		newOutput?.idCardCode = output?.ID_CARD_CODE
		newOutput?.idCardNo = output?.ID_CARD_NO
		newOutput?.intro = output?.INTRO
		newOutput?.jobNumber = output?.JOB_NUMBER
		newOutput?.jsonData = output?.JSON_DATA
		newOutput?.lastModifiedByCode = output?.LAST_MODIFIED_BY_CODE
		newOutput?.lastModifiedById = output?.LAST_MODIFIED_BY_ID
		newOutput?.lastModifiedDate = output?.LAST_MODIFIED_DATE
		newOutput?.lastName = output?.LAST_NAME
		newOutput?.lastSyncTime = output?.LAST_SYNC_TIME
		newOutput?.locus = output?.LOCUS
		newOutput?.marryStateCode = output?.MARRY_STATE_CODE
		newOutput?.mobilePhone = output?.MOBILE_PHONE
		newOutput?.name = output?.NAME
		newOutput?.namePinyin = output?.NAME_PINYIN
		newOutput?.orderBy = output?.ORDER_BY_
		newOutput?.orgCode = output?.ORG_CODE
		newOutput?.password = output?.PASSWORD_
		newOutput?.passwordSalt = output?.PASSWORD_SALT
		newOutput?.personalCode = output?.PERSONAL_CODE
		newOutput?.personalId = output?.PERSONAL_ID
		newOutput?.portraitUrl = output?.PORTRAIT_URL
		newOutput?.privatePassword = output?.PRIVATE_PASSWORD
		newOutput?.privatePasswordSalt = output?.PRIVATE_PASSWORD_SALT
		newOutput?.professionCode = output?.PROFESSION_CODE
		newOutput?.provinceCode = output?.PROVINCE_CODE
		newOutput?.qq = output?.QQ
		newOutput?.regionCode = output?.REGION_CODE
		newOutput?.remark = output?.REMARK
		newOutput?.sexCode = output?.SEX_CODE
		newOutput?.siteCode = output?.SITE_CODE
		newOutput?.sourceCode = output?.SOURCE_CODE
		newOutput?.stateCode = output?.STATE_CODE
		newOutput?.syncReturnCode = output?.SYNC_RETURN_CODE
		newOutput?.syncReturnMessage = output?.SYNC_RETURN_MESSAGE
		newOutput?.systemInfoCode = output?.SYSTEM_INFO_CODE
		newOutput?.telephone = output?.TELEPHONE
		newOutput?.thirdPartyCode = output?.THIRD_PARTY_CODE
		newOutput?.userCode = output?.USER_CODE
		newOutput?.userId = output?.USER_ID
		newOutput?.version = output?.VERSION_

        newOutput
    }
}